package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Hotel extends BaseDomain{

    private String name;

    private String coverUrl;

    private String content;

    private BigDecimal price;

    private Region place;

    private Date start_time;

    private Date end_time;

    private Integer bed_num;

    public String getJson() {
        Map<String, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("coverUrl", coverUrl);
        map.put("content", content);
        map.put("price", price);
        map.put("bed_num", bed_num);
        if (place != null) {
            map.put("place", place);
        }
        return JSONUtil.toJSONString(map);
    }

}